home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.3 / Video Toaster v4.3.iso / 4.2 / arexx / editor / oz / 61-set-fx < prev    next >
Text File  |  1998-04-16  |  3KB  |  108 lines

  1. /* Set Fades v1.3 - sets SMOOTH FADE lengths to a preset timing.  Operates from selected still through to STOP icon, or End of Project.  */
  2.  
  3.  
  4. /* By Aussie - ©1995 Michael Holten
  5.    To use - highlight a SMOOTH FADE effect.  Then run this ARexx routine.  It will allow you to set a timing for this and every SMOOTH FADE effect that follows.  Place a STOP icon in your project to limit this routine. */
  6.  
  7.  
  8. call remlib('PROJECT_REXX_PORT')
  9. call addlib('PROJECT_REXX_PORT',0)
  10.  
  11.  
  12. start_loc=croutonspot()
  13. project_end=croutonsinproject()
  14. current_spot=start_loc
  15.  
  16.  
  17. call croutonpick(current_spot)
  18.  
  19.  
  20. /* --- wait for any screen update delay --- */
  21. call time('R')
  22. do while (time('E')<0.5)
  23.  
  24.  
  25. call req_open("Set Fade Times - by Aussie","---------------------------","Sets all SMOOTH FADE effects to the same duration.","From selected clip to STOP icon, or end.")
  26.  
  27. if (croutontype()~="ALGO") then do
  28.    call req_tell("<< Canceled >>","     Select a FADE EFFECT first")
  29.    call req_close()
  30.    call quit()
  31.    end
  32.  
  33.  
  34. f_numfields=croutongettag(numfields)
  35. f_numframes=(f_numfields%2)
  36.  
  37. f_want=req_time("Set duration",f_numframes)
  38. if f_want="CANCEL" then do
  39.    call req_close()
  40.    call quit()
  41.    end
  42.  
  43.  
  44.  
  45.  
  46. fm=substr(f_want,4,2)
  47. fs=substr(f_want,7,2)
  48. ff=substr(f_want,10,2)
  49. f_all=((fm*1800)+(fs*30)+ff)*2
  50.  
  51. if f_all<2 then do
  52.    call req_tell("<< Canceled >>" ,"  Zero length is too small")
  53.    call req_close()
  54.    call quit()
  55.    end
  56.  
  57. /* Proceed or not */
  58. test=req_tell("Duration of " f_want ,"      Set fades to this duration?")
  59. call req_close()
  60. if test=0 then call quit()
  61.  
  62.  
  63. /* f_numfields=(test*2) */
  64. call croutonsettag(variablefcount,f_all)
  65. call croutonsettag(numfields,f_all)
  66. call croutonsettag(fcountmode,2)
  67. call croutonsettag(numframesvariable,(f_all%2))
  68.  
  69.  
  70.  
  71. do while (current_spot<project_end)
  72.    current_spot=current_spot+1
  73.    call croutonpick(current_spot)
  74.    if (croutontype()="ALGO") then do
  75.       call croutonsettag(numfields,f_all)
  76.       call croutonsettag(variablefcount,f_all)
  77.       call croutonsettag(fcountmode,2)
  78.       call croutonsettag(numframesvariable,(f_all%2))
  79.       end
  80.    if croutontype()="CTRL" then do
  81.       test=croutonname()
  82.       test1=right(test,length(test)-lastpos("/",test))
  83.       test3=("STOP" = upper(test1))
  84.       if test3=1 then do
  85.          call projectupdate()
  86.          call croutonpick(start_loc)
  87.          call req_error(" OZ:  Performed till STOP icon!  <<< Fades have new matching times >>>")
  88.          call quit2()
  89.          end
  90.       end
  91.  
  92.    end
  93.  
  94. call projectupdate()
  95. call croutonpick(start_loc)
  96. call req_error(" OZ:   All Done!   <<< Fades have new matching times >>>")
  97. call quit2()
  98.  
  99.  
  100. quit:
  101. call croutonpick(start_loc)
  102. call req_error(" OZ:   <<< Last Operation Canceled >>>")
  103.  
  104. quit2:
  105. call remlib("PROJECT_REXX_PORT")
  106.  
  107. exit
  108.